40823152cd2021

  • Home
    • Site Map
    • reveal
    • blog
  • about
  • W1-W4
    • W1
      • leo教學
      • 分組(2人專案)
    • W2
      • 轉軸問題
      • 擊球問題
      • coppeliaSim 比例問題
    • W3
      • 製作簡報
      • 小組網站(共同維護)
    • W4
      • 報告
      • cd2021_2a_age影片排序
      • Ant Renamer 操作說明
  • W5-w9
    • W5
      • stage2-ag12
      • 產品目標
      • 工作分配
    • W6
      • Lua control speed
    • W7
      • keyboard control
      • keyboard control for Four-bar linkage
    • W8
      • Inquire keyboard number
      • basketball Machine 2.4.3
  • stage1-product
    • 版本一
    • 版本二
    • 版本三
    • 版本四
    • pdf
  • Stage2-product
    • 2.1
    • 2.2
    • 2.3
    • 2.4
  • Stage3
    • W10
      • task1
      • task2
    • W11
      • task 1 教學
    • W12
      • stage2-ag12 python keyboard
    • W13
      • gitlab操作
      • xml
    • W14
      • fanuc_m710ic_50_pick_and_place
      • fanuc_m710ic_50_pick_and_place add suction ped
    • W15
      • MTB_robot_pick_and_place
      • MTB_robot_pick_and_place delete GUI
      • Movie subtite
    • W16
      • MTB_robot onshape
      • MTB_robot coppeliasim
      • MTB_robot add suction pad
      • MTB_robot add IK
      • MTB_robot python remote api
      • MTB_robo use require
    • W17
      • basketball machine add Mtb_robot
      • basketball machine final
    • W18
  • github flagged
  • Bug
    • Wsgi.py 打不開
W17 << Previous Next >> basketball machine final

basketball machine add Mtb_robot

籃球機增加Mtb_robot取放球,還沒有計算位置,所以無法準確放到(x=1.002,y=0)點上。

3.0


使用老師的ik程式,使Mtb_robot放球到最終的位置(x=1.002,y=0)

但是把MTB_robot放到籃球機的場景裡,不能直接在程式裡打ik(1.002,0),因為MTB_robot沒有在座標原點上,所以要減掉MTB_robot的座標(0.7496,-2.3502),得出(0.2506,2.3502),才會移動到正確的座標。

3.1

-- The decimal point of number x is rounded to the nth place
function round(x, n)
    n = math.pow(10, n or 0)
    x = x * n
    if x >= 0 then x = math.floor(x + 0.5) else x = math.ceil(x - 0.5) end
    return x / n
end
  
-- radian to degree
deg = 180/math.pi
-- link 1 length
a1 =0.467*3
-- link 2 length
a2 =0.4*3
-- derivated based upon https://www.youtube.com/watch?v=IKOGwoJ2HLk&t=311s
function ik(x, y)
    -- (x, y) need to be located inside the circle with radius a1+a2
    if (x^2 + y^2) <= (a1+ a2)^2 then
        q2 = math.acos((x^2+y^2-a1^2-a2^2)/(2*a1*a2))
        q1 = math.atan2(y, x) - math.atan2((a2*math.sin(q2)), (a1+a2*math.cos(q2)))
        return {round(q1*deg, 4), round(q2*deg, 4)}
    else
        print("Over range!")
        -- end the script execution
        os.exit()
    end
end
  
theta = ik(0.2506, 2.3502)
  
print(theta[1], theta[2])

教學如何使用逆向運動函式使用在MTB_robot

檔案

教學影片:


W17 << Previous Next >> basketball machine final

Copyright © All rights reserved | This template is made with by Colorlib